package com.lianxueda.drawing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lianxueda.drawing.domain.pojo.CourseStudent;
import com.lianxueda.drawing.mapper.CourseStudentMapper;
import com.lianxueda.drawing.service.CourseStudentService;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 29264
* @description 针对表【course_student】的数据库操作Service实现
* @createDate 2024-08-26 14:49:05
*/
@Service

public class CourseStudentServiceImpl extends ServiceImpl<CourseStudentMapper, CourseStudent>
    implements CourseStudentService{

    @Resource
    private  CourseStudentMapper courseStudentMapper;





    public List<Integer> selectCourseId(Integer studentId) {
        return courseStudentMapper.selectCourseIdsByStudentId(studentId);
    }

    @Override
    public Integer addCourseForStudent(Integer studentId, Integer courseId) {

        return courseStudentMapper.insertCourseStudent(studentId, courseId);
    }

    @Override
    public List<Integer> selectStudentsByCourseIds(List<Integer> courseIds) {

        return courseStudentMapper.selectStudentsByCourseIds(courseIds);
    }
}




